<?php 
namespace  api\modules\v1\controllers;

use yii\web\Controller;
use yii\rest\ActiveController;
use yii\filters\auth\HttpBasicAuth;
use yii\web\Response;
use frontend\models\Article;

class ArticleController extends ActiveController{
	public $modelClass = 'frontend\models\Article';

	public function behaviors(){
	    $behaviors = parent::behaviors();
	    // $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_HTML;
	    $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
	    return $behaviors;
	}

	//获取所有文章
	public function actionArticleList(){
		$articleModel=new Article();

		return $articleModel->getArticleAll();


	}




}












 ?>